﻿/*----------------------------------------------------------------
// Copyright (C) 2011 上海
// 版权所有。 
//
// 文件名：YaxMachineVM
// 文件功能描述：设备管理models层
//
// 
// 创建标识：2012-02-12 王冲
//
// 修改标识：
// 修改描述：
//
//
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace WaiGaoQiaoWeb.Models
{
    public class YaxMachineVM
    {   
        public int MacID
        {
            get;
            set;
        }

        [Display(Name = "设备组ID")]
        public int NodeID
        {
            get;
            set;
        }
        [Required(ErrorMessage = "设备编号不能为空")]
        [Display(Name = "设备编号")]
        [Remote("CheckMacNo", "YaxMachine", AdditionalFields = "MacNo,OldMacNo,AddEdit", HttpMethod = "POST", ErrorMessage = "已存在此设备编号")]
        public int MacNo
        {
            get;
            set;
        }
        [Required(ErrorMessage = "设备编号不能为空")]
        [Display(Name = "设备编号")]
        [Remote("CheckMacNoAdd", "YaxMachine", AdditionalFields = "MacNoAdd", HttpMethod = "POST", ErrorMessage = "已存在此设备编号")]
        public int MacNoAdd
        {
            get;
            set;
        }

        [Display(Name = "设备类型ID")]
        public int MacType
        {
            get;
            set;
        }

        [Display(Name = "通讯方式")]
        public int CommStyle
        {
            get;
            set;
        }

        [Display(Name = "通讯方式")]
        public string CommStyle_
        {
            get;
            set;
        }

        [Display(Name = "设备组名称")]
        public string NodeName
        {
            get;
            set;
        }

        [Display(Name = "设备类型名称")]
        public string MacTypeName
        {
            get;
            set;
        }
        [Required(ErrorMessage = "端口号不能为空")]
        [Display(Name = "端口号")]
        public int PortNo
        {
            get;
            set;
        }

        [Display(Name = "IP地址")]
        public string IPAddress
        {
            get;
            set;
        }

        [Display(Name = "网关")]
        public string GetwayIP
        {
            get;
            set;
        }
        [RegularExpression(@"^[0-9]+(.[0-9]{0,3})?$", ErrorMessage = "波特率只能是数字")]
        [Display(Name = "波特率")]
        public string BaudRate
        {
            get;
            set;
        }

        [Display(Name = "设备描述")]
        public string MacDescribe
        {
            get;
            set;
        }

        [Display(Name = "子网掩码")]
        public string SubIPAddr
        {
            get;
            set;
        }

        public int tab1
        {
            get;
            set;
        }

        public int OldMacNo
        {
            get;
            set;
        }

        public string AddEdit
        {
            get;
            set;
        }
    }
}